Skip to content

Conversation

@david-morales
Copy link

Summary

  • Fixes RediSearch query syntax errors when entity names contain forward slashes
  • Adds / to the separator map in FalkorDB's sanitize() method

Problem

When entity names contained forward slashes (e.g., "Cruise / En route"), RediSearch queries were failing with syntax errors because the forward slash was not being sanitized. This resulted in malformed queries like:

(@group_id:\_) (Cruise | / | En | route)

Solution

Added / to the separator_map in the sanitize() method (line 324 in falkordb_driver.py), treating it like other special characters by replacing it with whitespace.

Now "Cruise / En route" is sanitized to "Cruise En route", which produces valid RediSearch queries.

Testing

Verified that:

  • "Cruise / En route" → "Cruise En route"
  • "Landing/Taxi" → "Landing Taxi"
  • Multiple slashes are handled correctly

Fixes data insertion issues when using FalkorDB backend with forward slash characters in entity names.

When entity names contained forward slashes (e.g., "Cruise / En route"),
RediSearch queries were failing with syntax errors because the forward
slash was not being sanitized.

This adds '/' to the separator map in FalkorDB's sanitize() method,
treating it like other special characters by replacing it with whitespace.

Fixes RediSearch query syntax errors when inserting data with forward slashes.
sgaluza added a commit to sgaluza/graphiti that referenced this pull request Jan 14, 2026
Add forward slash (/), backslash (\), and pipe (|) to the sanitize()
method to prevent RediSearch query syntax errors.

RediSearch uses these characters with special meaning:
- | is the OR operator
- \ is the escape character
- / causes query syntax errors in entity names

Updated docstring with:
- Reference to RediSearch escaping documentation
- Note that this is for fulltext search, not exact path matching

Fixes getzep#1144
Related to getzep#1118

Built with [OnSteroids](https://onsteroids.ai)

Co-Authored-By: OnSteroids <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant